package com.siqi.hr.system.common.sql;

import com.siqi.hr.system.custom.entity.EntityRecord;

/**
 * 实体与实体关系表对象
 * @author xiaogq
 */
public class RelatedConfig  implements Parsable<RelatedTable>{

    @Override
    public RelatedTable parse() {
        return new RelatedTable(this.relatedTableName);
    }

    public RelatedConfig(String relatedTableName, Integer serial) {
        this.relatedTableName = relatedTableName;
        this.serial = serial;
    }

    /**
     * id
     */
    private Integer id;

    /**
     * 主表(主实体id)
     */
    private EntityRecord hostEntityRecord;

    /**
     * 相关实体id
     */
    private EntityRecord relatedEntityRecord;

    /**
     * 引用字段后缀索引
     */
    private Integer serial;

    /**
     * 实体与实体关系表名
     */
    private String relatedTableName;

    public String getRelatedTableName() {
        return relatedTableName;
    }

    public void setRelatedTableName(String relatedTableName) {
        this.relatedTableName = relatedTableName;
    }

    public EntityRecord getHostEntityRecord() {
        return hostEntityRecord;
    }

    public void setHostEntityRecord(EntityRecord hostEntityRecord) {
        this.hostEntityRecord = hostEntityRecord;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public EntityRecord getRelatedEntityRecord() {
        return relatedEntityRecord;
    }

    public void setRelatedEntityRecord(EntityRecord relatedEntityRecord) {
        this.relatedEntityRecord = relatedEntityRecord;
    }

    public Integer getSerial() {
        return serial;
    }

    public void setSerial(Integer serial) {
        this.serial = serial;
    }

}
